unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,system.ZLib;

type
  TForm1 = class(TForm)
    Btnx_1: TButton;
    procedure Btnx_1Click(Sender: TObject);
  private
  public
  end;

var
  Form1: TForm1;

implementation

uses
  Class_KzDebug;

{$R *.dfm}

procedure TForm1.Btnx_1Click(Sender: TObject);
var
  SVAL:string;
  List:TStringList;
  Source:string;
  Target:TBytes;
begin
  List:=TStringList.Create;
  List.LoadFromFile('compress.txt');
  Source:=Trim(List.Text);
  ShowMessageFmt('%D',[Source.Length]);
  Target:=System.ZLib.ZCompressStr(List.Text,zcMax);
  SVAL:=TEncoding.Unicode.GetString( Target );
  ShowMessageFmt('%D',[SVAL.Length]);

  KzDebug.FileFmt('%S:%S',[Self.ClassName,SVAL]);
  SVAL:=System.ZLib.ZDecompressStr(Target);
  KzDebug.FileFmt('%S:%S',[Self.ClassName,SVAL]);
end;

end.
